﻿namespace ExamV5.GradeInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmRubricAN : Page
    {
        protected GridView DataGridInfo;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        private int[] int_1;
        private int[] int_10;
        private int[] int_2;
        private int[] int_3;
        private int[] int_4;
        private int[] int_5;
        private int[] int_6;
        private int[] int_7;
        private int[] int_8;
        private int[] int_9;
        protected Label labTitle;
        private PublicFun publicFun_0 = new PublicFun();
        protected ScriptManager SM;
        private string string_0 = "";
        private string string_1 = "";
        private string[] string_10;
        private string[] string_11;
        private string[] string_2;
        private string[] string_3;
        private string[] string_4;
        private string[] string_5;
        private string[] string_6;
        private string[] string_7;
        private string[] string_8;
        private string[] string_9;
        protected UpdatePanel UPPart;

        protected void DataGridInfo_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.DataItemIndex == -1)
            {
                this.DataGridInfo.Attributes.Add("oldValue", "#FFFFFF");
                this.DataGridInfo.Attributes.Add("singleValue", "#FFFFFF");
            }
            else
            {
                e.Row.Attributes.Add("onmouseover", "this.bgColor='#F6F5F5'");
                if ((e.Row.DataItemIndex % 2) != 0)
                {
                    e.Row.Attributes.Add("bgcolor", "#FFFFFF");
                    e.Row.Attributes.Add("onmouseout", "this.bgColor=document.getElementById('DataGridInfo').getAttribute('oldValue')");
                }
                else
                {
                    e.Row.Attributes.Add("bgcolor", "#FFFFFF");
                    e.Row.Attributes.Add("onmouseout", "this.bgColor=document.getElementById('DataGridInfo').getAttribute('singleValue')");
                }
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int num2;
                double num3;
                if (e.Row.Cells[1].Text.Trim().Length <= 12)
                {
                    e.Row.Cells[1].Text = "<a  title=" + e.Row.Cells[1].Text + ">" + e.Row.Cells[1].Text.Trim() + "</a>";
                }
                else
                {
                    e.Row.Cells[1].Text = "<a  title=" + e.Row.Cells[1].Text + ">" + e.Row.Cells[1].Text.Trim().Substring(0, 12) + "…</a>";
                }
                e.Row.Cells[3].Text = this.publicFun_0.RemoveHTML(e.Row.Cells[3].Text).Replace("&lt;BR&gt;", "").Replace("&lt;br&gt;", "").Replace("&nbsp;", "");
                if (e.Row.Cells[3].Text.Length > (Convert.ToInt32(this.ViewState["SubStrLen"].ToString()) + 15))
                {
                    e.Row.Cells[3].Text = "<a title=" + e.Row.Cells[3].Text + ">" + e.Row.Cells[3].Text.Substring(0, Convert.ToInt32(this.ViewState["SubStrLen"].ToString()) + 15) + "…</a>";
                }
                e.Row.Cells[2].Text = this.publicFun_0.GetRubricType(e.Row.Cells[2].Text.Trim(), "0");
                Label label = (Label) e.Row.Cells[4].FindControl("labCount");
                Label label3 = (Label) e.Row.Cells[5].FindControl("labEdit");
                Label label2 = (Label) e.Row.Cells[5].FindControl("labLook");
                if (this.ViewState["ManagPower"].ToString() != "Y")
                {
                    if (!(!(this.ViewState["AddPower"].ToString() != "Y") ? !(this.httpCookie_0.Value != this.DataGridInfo.DataKeys[e.Row.RowIndex]["CreatNumberNO"].ToString()) : false))
                    {
                        label3.ToolTip = "此题您无修改权限！";
                    }
                    else
                    {
                        label3.Text = "<a href='#' onclick=javascript:EditRubric('" + this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString() + "');>" + label3.Text + "</a>";
                    }
                }
                else
                {
                    label3.Text = "<a href='#' onclick=javascript:EditRubric('" + this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString() + "');>" + label3.Text + "</a>";
                }
                label2.Text = "<a href='#' onclick=javascript:ShowRubric('" + this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString() + "');>" + label2.Text + "</a>";
                this.string_0 = this.ViewState["CountCheck"].ToString();
                switch (this.DataGridInfo.DataKeys[e.Row.RowIndex]["RubricType"].ToString())
                {
                    case "A":
                        for (num2 = 0; num2 < this.string_2.Length; num2++)
                        {
                            if (this.string_2[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_1[num2]);
                                if (!(num3 == 0.0))
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                                else
                                {
                                    label.Text = "0.00%";
                                }
                            }
                        }
                        break;

                    case "B":
                        for (num2 = 0; num2 < this.string_3.Length; num2++)
                        {
                            if (this.string_3[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_2[num2]);
                                if (num3 == 0.0)
                                {
                                    label.Text = "0.00%";
                                }
                                else
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                            }
                        }
                        break;

                    case "C":
                        for (num2 = 0; num2 < this.string_4.Length; num2++)
                        {
                            if (this.string_4[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_3[num2]);
                                if (num3 == 0.0)
                                {
                                    label.Text = "0.00%";
                                }
                                else
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                            }
                        }
                        break;

                    case "D":
                        for (num2 = 0; num2 < this.string_5.Length; num2++)
                        {
                            if (this.string_5[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_4[num2]);
                                if (num3 == 0.0)
                                {
                                    label.Text = "0.00%";
                                }
                                else
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                            }
                        }
                        break;

                    case "E":
                        for (num2 = 0; num2 < this.string_6.Length; num2++)
                        {
                            if (this.string_6[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_5[num2]);
                                if (!(num3 == 0.0))
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                                else
                                {
                                    label.Text = "0.00%";
                                }
                            }
                        }
                        break;

                    case "F":
                        for (num2 = 0; num2 < this.string_7.Length; num2++)
                        {
                            if (this.string_7[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_6[num2]);
                                if (!(num3 == 0.0))
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                                else
                                {
                                    label.Text = "0.00%";
                                }
                            }
                        }
                        break;

                    case "G":
                        for (num2 = 0; num2 < this.string_8.Length; num2++)
                        {
                            if (this.string_8[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_7[num2]);
                                if (!(num3 == 0.0))
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                                else
                                {
                                    label.Text = "0.00%";
                                }
                            }
                        }
                        break;

                    case "H":
                        for (num2 = 0; num2 < this.string_9.Length; num2++)
                        {
                            if (this.string_9[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_8[num2]);
                                if (num3 == 0.0)
                                {
                                    label.Text = "0.00%";
                                }
                                else
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                            }
                        }
                        break;

                    case "I":
                        for (num2 = 0; num2 < this.string_10.Length; num2++)
                        {
                            if (this.string_10[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_9[num2]);
                                if (!(num3 == 0.0))
                                {
                                    num3 /= Convert.ToDouble(this.string_0);
                                    label.Text = num3.ToString("0.00%");
                                }
                                else
                                {
                                    label.Text = "0.00%";
                                }
                            }
                        }
                        break;

                    case "J":
                        for (num2 = 0; num2 < this.string_11.Length; num2++)
                        {
                            if (this.string_11[num2].Trim() == this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString())
                            {
                                num3 = Convert.ToDouble(this.int_10[num2]);
                                if (!(num3 == 0.0))
                                {
                                    label.Text = (num3 / Convert.ToDouble(this.string_0)).ToString("0.00%");
                                }
                                else
                                {
                                    label.Text = "0.00%";
                                }
                            }
                        }
                        break;
                }
                label.Text = string.Concat(new object[] { "<a href='#' onclick=javascript:ShowWriteUser('", this.DataGridInfo.DataKeys[e.Row.RowIndex]["ID"].ToString(), "','", this.int_0, "');>", label.Text, "</a>" });
            }
            if (e.Row.RowType == DataControlRowType.Header)
            {
                string str;
                if (this.ViewState["SortType"].ToString() != " Desc")
                {
                    str = this.ViewState["SortFiled"].ToString();
                    if (str != null)
                    {
                        if (str == "Flag")
                        {
                            e.Row.Cells[0].Controls.Add(new LiteralControl("↓"));
                        }
                        else if (!(str == "SubjectName"))
                        {
                            if (str == "RubricType")
                            {
                                e.Row.Cells[2].Controls.Add(new LiteralControl("↓"));
                            }
                        }
                        else
                        {
                            e.Row.Cells[1].Controls.Add(new LiteralControl("↓"));
                        }
                    }
                }
                else
                {
                    str = this.ViewState["SortFiled"].ToString();
                    switch (str)
                    {
                        case null:
                            goto Label_1055;

                        case "Flag":
                            e.Row.Cells[0].Controls.Add(new LiteralControl("↑"));
                            return;
                    }
                    if (!(str == "SubjectName"))
                    {
                        if (!(str == "RubricType"))
                        {
                            goto Label_1055;
                        }
                        e.Row.Cells[2].Controls.Add(new LiteralControl("↑"));
                    }
                    else
                    {
                        e.Row.Cells[1].Controls.Add(new LiteralControl("↑"));
                    }
                }
            }
            return;
        Label_1055:
            e.Row.Cells[2].Controls.Add(new LiteralControl("↑"));
        }

        protected void DataGridInfo_Sorting(object sender, GridViewSortEventArgs e)
        {
            string sortExpression = e.SortExpression;
            if (!(this.ViewState["SortFiled"].ToString() == sortExpression))
            {
                this.ViewState["SortFiled"] = e.SortExpression;
            }
            else if (this.ViewState["SortType"].ToString() == " Desc")
            {
                this.ViewState["SortType"] = " ASC";
            }
            else
            {
                this.ViewState["SortType"] = " Desc";
            }
            this.method_12();
        }

        protected void DataGridInfo_PreRender(object sender, EventArgs e)
        {
            // 使用<TH>替换<TD> 
            this.DataGridInfo.UseAccessibleHeader = true;
            //HeaderRow将被<thead>包裹，数据行将被<tbody>包裹
            this.DataGridInfo.HeaderRow.TableSection = TableRowSection.TableHeader;
        }

        private void method_0()
        {
            int num;
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand("select top 1 b.ExamName,a.RubricS,a.RubricD,a.RubricB,a.RubricF,a.RubricA,a.RubricC,a.RubricT,a.RubricAN,a.RubricO,a.RubricJ from PaperData a,PaperInfo b where b.ID=a.PaperID and a.PaperID=" + this.int_0, connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            if (reader.Read())
            {
                this.labTitle.Text = "【" + reader["ExamName"].ToString() + "】考试试题正确率统计分析表";
                this.string_1 = reader["RubricS"].ToString() + reader["RubricD"].ToString() + reader["RubricB"].ToString() + reader["RubricF"].ToString() + reader["RubricA"].ToString() + reader["RubricC"].ToString() + reader["RubricT"].ToString() + reader["RubricAN"].ToString() + reader["RubricO"].ToString() + reader["RubricJ"].ToString();
                this.string_2 = reader["RubricS"].ToString().Split(new char[] { '#' });
                this.string_3 = reader["RubricD"].ToString().Split(new char[] { '#' });
                this.string_4 = reader["RubricB"].ToString().Split(new char[] { '#' });
                this.string_5 = reader["RubricF"].ToString().Split(new char[] { '#' });
                this.string_6 = reader["RubricA"].ToString().Split(new char[] { '#' });
                this.string_7 = reader["RubricC"].ToString().Split(new char[] { '#' });
                this.string_8 = reader["RubricT"].ToString().Split(new char[] { '#' });
                this.string_9 = reader["RubricAN"].ToString().Split(new char[] { '#' });
                this.string_10 = reader["RubricO"].ToString().Split(new char[] { '#' });
                this.string_11 = reader["RubricJ"].ToString().Split(new char[] { '#' });
                this.int_1 = new int[this.string_2.Length];
                this.int_2 = new int[this.string_3.Length];
                this.int_3 = new int[this.string_4.Length];
                this.int_4 = new int[this.string_5.Length];
                this.int_5 = new int[this.string_6.Length];
                this.int_6 = new int[this.string_7.Length];
                this.int_7 = new int[this.string_8.Length];
                this.int_8 = new int[this.string_9.Length];
                this.int_9 = new int[this.string_10.Length];
                this.int_10 = new int[this.string_11.Length];
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
            for (num = 0; num < this.int_1.Length; num++)
            {
                this.int_1[num] = 0;
            }
            for (num = 0; num < this.int_2.Length; num++)
            {
                this.int_2[num] = 0;
            }
            for (num = 0; num < this.int_3.Length; num++)
            {
                this.int_3[num] = 0;
            }
            for (num = 0; num < this.int_4.Length; num++)
            {
                this.int_4[num] = 0;
            }
            for (num = 0; num < this.int_5.Length; num++)
            {
                this.int_5[num] = 0;
            }
            for (num = 0; num < this.int_6.Length; num++)
            {
                this.int_6[num] = 0;
            }
            for (num = 0; num < this.int_7.Length; num++)
            {
                this.int_7[num] = 0;
            }
            for (num = 0; num < this.int_8.Length; num++)
            {
                this.int_8[num] = 0;
            }
            for (num = 0; num < this.int_9.Length; num++)
            {
                this.int_9[num] = 0;
            }
            for (num = 0; num < this.int_10.Length; num++)
            {
                this.int_10[num] = 0;
            }
            this.method_1();
        }

        private void method_1()
        {
            string str2 = "";
            string str3 = "";
            string str4 = "";
            string str5 = "";
            string str6 = "";
            string str7 = "";
            string str8 = "";
            string str9 = "";
            string str10 = "";
            string str11 = "";
            string str12 = "";
            string str13 = "";
            string str14 = "";
            string str15 = "";
            string str16 = "";
            string str17 = "";
            string str18 = "";
            string str19 = "";
            string str20 = "";
            string str21 = "";
            string str22 = "";
            string str23 = "";
            string str24 = "";
            string str25 = "";
            string str26 = "";
            string str27 = "";
            string str28 = "";
            string str29 = "";
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand("select a.RubricDist,a.ExamName,b.RubricS,RubricD,RubricB,RubricF,RubricA,RubricC,RubricT,RubricAN,RubricO,RubricJ,SortInfo,c.RubricSFen,c.RubricDFen,c.RubricBFen,c.RubricFFen,c.RubricAFen,c.RubricCFen,c.RubricTFen,c.RubricANFen,c.RubricOFen,c.RubricJFen,c.CheckUserFFen,c.CheckUserAFen,c.CheckUserCFen,c.CheckUserTFen,c.CheckUserANFen,c.CheckUserOFen,c.CheckUserJFen from PaperInfo a,PaperData b,CheckPaper c where c.PaperID=a.ID and b.UserCode=c.UserCode and  a.ID=b.PaperID and a.ID=" + this.int_0, connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            while (reader.Read())
            {
                str2 = reader["SortInfo"].ToString();
                str3 = reader["RubricS"].ToString();
                str4 = reader["RubricD"].ToString();
                str5 = reader["RubricB"].ToString();
                str6 = reader["RubricF"].ToString();
                str7 = reader["RubricA"].ToString();
                str8 = reader["RubricC"].ToString();
                str9 = reader["RubricT"].ToString();
                str10 = reader["RubricAN"].ToString();
                str11 = reader["RubricO"].ToString();
                str12 = reader["RubricJ"].ToString();
                str13 = reader["RubricSFen"].ToString();
                str14 = reader["RubricDFen"].ToString();
                str15 = reader["RubricBFen"].ToString();
                str16 = reader["RubricFFen"].ToString();
                str17 = reader["RubricAFen"].ToString();
                str18 = reader["RubricCFen"].ToString();
                str19 = reader["RubricTFen"].ToString();
                str20 = reader["RubricANFen"].ToString();
                str21 = reader["RubricOFen"].ToString();
                str22 = reader["RubricJFen"].ToString();
                str23 = reader["CheckUserFFen"].ToString();
                str24 = reader["CheckUserAFen"].ToString();
                str25 = reader["CheckUserCFen"].ToString();
                str26 = reader["CheckUserTFen"].ToString();
                str27 = reader["CheckUserANFen"].ToString();
                str28 = reader["CheckUserOFen"].ToString();
                str29 = reader["CheckUserJFen"].ToString();
                string[] strArray = str2.Split(new char[] { '#' });
                if (str3.Trim() != "")
                {
                    this.method_2(str3, strArray[0], str13);
                }
                if (str4.Trim() != "")
                {
                    this.method_3(str4, strArray[1], str14);
                }
                if (str5.Trim() != "")
                {
                    this.method_4(str5, strArray[2], str15);
                }
                if (str6.Trim() != "")
                {
                    this.method_5(str6, strArray[3], str16, str23);
                }
                if (str7.Trim() != "")
                {
                    this.method_6(str7, strArray[4], str17, str24);
                }
                if (str8.Trim() != "")
                {
                    this.method_7(str8, strArray[5], str18, str25);
                }
                if (str9.Trim() != "")
                {
                    this.method_8(str9, strArray[6], str19, str26);
                }
                if (str10.Trim() != "")
                {
                    this.method_9(str10, strArray[7], str20, str27);
                }
                if (str11.Trim() != "")
                {
                    this.method_10(str11, strArray[8], str21, str28);
                }
                if (str12.Trim() != "")
                {
                    this.method_11(str12, strArray[9], str22, str29);
                }
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
        }

        private void method_10(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='I'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "IRubric");
            for (int i = 0; i < dataSet.Tables["IRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_10.Length; j++)
                {
                    if (this.string_10[j].Trim() == dataSet.Tables["IRubric"].Rows[i]["ID"].ToString())
                    {
                        if (!((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true))
                        {
                            if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                            {
                                this.int_9[j]++;
                            }
                        }
                        else if (((strArray2.Length > 1) && ((strArray2[i].Trim() != "0") && (strArray2[i].Trim() != ""))) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                        {
                            this.int_9[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_11(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo  where RubricType='J'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "JRubric");
            for (int i = 0; i < dataSet.Tables["JRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_11.Length; j++)
                {
                    if (this.string_11[j].Trim() == dataSet.Tables["JRubric"].Rows[i]["ID"].ToString())
                    {
                        if (!(strArray[i].Trim() != "0") || !(strArray[i].Trim() != ""))
                        {
                            if (((strArray2.Length > 1) && ((strArray2[i].Trim() != "0") && (strArray2[i].Trim() != ""))) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                            {
                                this.int_10[j]++;
                            }
                        }
                        else if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                        {
                            this.int_10[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_12()
        {
            string selectCommandText = "";
            selectCommandText = "select a.RubricType,a.IsDel,a.OptionAnswer,a.OKAnswer,a.CreatNumberNO,a.ID,b.SubjectName,b.EditUserCode,a.RubricType,a.RubricTitle,Flag=case a.Flag when 'A' then '正规题库' when 'B' then '练习题库' when 'C' then '模拟题库' when 'D' then '竞赛题库'  when 'E' then '每日一题' end";
            selectCommandText = selectCommandText + " from RubricInfo a,SubjectInfo b  where  a.SubjectID=b.ID ";
            if (this.string_1.Length <= 1)
            {
                this.string_1 = "0,0";
            }
            else
            {
                this.string_1 = this.string_1.Substring(0, this.string_1.Length - 1);
                this.string_1 = this.string_1.Replace("#", ",");
            }
            selectCommandText = (selectCommandText + " and a.ID in(" + this.string_1 + ")") + " order by " + this.ViewState["SortFiled"].ToString() + this.ViewState["SortType"].ToString();
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "DataInfo");
            this.DataGridInfo.DataSource = dataSet.Tables["DataInfo"].DefaultView;
            this.DataGridInfo.DataBind();
            adapter.Dispose();
            selectConnection.Close();
            selectConnection.Dispose();
        }

        private void method_2(string string_12, string string_13, string string_14)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='A'";
            string[] strArray = string_14.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "SRubric");
            for (int i = 0; i < dataSet.Tables["SRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_2.Length; j++)
                {
                    if (((this.string_2[j].Trim() == dataSet.Tables["SRubric"].Rows[i]["ID"].ToString()) && !((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true)) && (Convert.ToDouble(strArray[i].Trim()) > 0.0))
                    {
                        this.int_1[j]++;
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_3(string string_12, string string_13, string string_14)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='B'";
            string[] strArray = string_14.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "DRubric");
            for (int i = 0; i < dataSet.Tables["DRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_3.Length; j++)
                {
                    if ((!((this.string_3[j].Trim() == dataSet.Tables["DRubric"].Rows[i]["ID"].ToString()) ? !(this.string_3[j].Trim() != "") : true) && !((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true)) && (Convert.ToDouble(strArray[i].Trim()) > 0.0))
                    {
                        this.int_2[j]++;
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_4(string string_12, string string_13, string string_14)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='C'";
            string[] strArray = string_14.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "BRubric");
            for (int i = 0; i < dataSet.Tables["BRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_4.Length; j++)
                {
                    if (((this.string_4[j].Trim() == dataSet.Tables["BRubric"].Rows[i]["ID"].ToString()) && !((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true)) && (Convert.ToDouble(strArray[i].Trim()) > 0.0))
                    {
                        this.int_3[j]++;
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_5(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='D'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "FRubric");
            for (int i = 0; i < dataSet.Tables["FRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_5.Length; j++)
                {
                    if (this.string_5[j].Trim() == dataSet.Tables["FRubric"].Rows[i]["ID"].ToString())
                    {
                        if (!((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true))
                        {
                            if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                            {
                                this.int_4[j]++;
                            }
                        }
                        else if (((strArray2.Length > 1) && !((strArray2[i].Trim() != "0") ? !(strArray2[i].Trim() != "") : true)) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                        {
                            this.int_4[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_6(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='E'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "ARubric");
            for (int i = 0; i < dataSet.Tables["ARubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_6.Length; j++)
                {
                    if (this.string_6[j].Trim() == dataSet.Tables["ARubric"].Rows[i]["ID"].ToString())
                    {
                        if ((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true)
                        {
                            if (((strArray2.Length > 1) && !((strArray2[i].Trim() != "0") ? !(strArray2[i].Trim() != "") : true)) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                            {
                                this.int_5[j]++;
                            }
                        }
                        else if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                        {
                            this.int_5[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_7(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='F'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "CRubric");
            for (int i = 0; i < dataSet.Tables["CRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_7.Length; j++)
                {
                    if (this.string_7[j].Trim() == dataSet.Tables["CRubric"].Rows[i]["ID"].ToString())
                    {
                        if (!(strArray[i].Trim() != "0") || !(strArray[i].Trim() != ""))
                        {
                            if (((strArray2.Length > 1) && ((strArray2[i].Trim() != "0") && (strArray2[i].Trim() != ""))) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                            {
                                this.int_6[j]++;
                            }
                        }
                        else if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                        {
                            this.int_6[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_8(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='G'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "TRubric");
            for (int i = 0; i < dataSet.Tables["TRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_8.Length; j++)
                {
                    if (this.string_8[j].Trim() == dataSet.Tables["TRubric"].Rows[i]["ID"].ToString())
                    {
                        if ((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true)
                        {
                            if (((strArray2.Length > 1) && ((strArray2[i].Trim() != "0") && (strArray2[i].Trim() != ""))) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                            {
                                this.int_7[j]++;
                            }
                        }
                        else if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                        {
                            this.int_7[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        private void method_9(string string_12, string string_13, string string_14, string string_15)
        {
            string selectCommandText = "Select ID from RubricInfo where RubricType='H'";
            string[] strArray = string_14.Split(new char[] { '|' });
            string[] strArray2 = string_15.Split(new char[] { '|' });
            selectCommandText = selectCommandText + " and ID in(" + string_12.Replace("#", ",") + "0) order by " + string_13;
            SqlConnection selectConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, selectConnection);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet, "ANRubric");
            for (int i = 0; i < dataSet.Tables["ANRubric"].Rows.Count; i++)
            {
                for (int j = 0; j < this.string_9.Length; j++)
                {
                    if (this.string_9[j].Trim() == dataSet.Tables["ANRubric"].Rows[i]["ID"].ToString())
                    {
                        if (!((strArray[i].Trim() != "0") ? !(strArray[i].Trim() != "") : true))
                        {
                            if (Convert.ToDouble(strArray[i].Trim()) > 0.0)
                            {
                                this.int_8[j]++;
                            }
                        }
                        else if (((strArray2.Length > 1) && ((strArray2[i].Trim() != "0") && (strArray2[i].Trim() != ""))) && (Convert.ToDouble(strArray2[i].Trim()) > 0.0))
                        {
                            this.int_8[j]++;
                        }
                    }
                }
            }
            adapter.Dispose();
            dataSet.Clear();
            dataSet.Dispose();
            selectConnection.Dispose();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            if ((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false)
            {
                this.int_0 = Convert.ToInt32(base.Request["ID"].ToString());
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                if (!base.IsPostBack)
                {
                    if (this.publicFun_0.ReturnPaperData() == "Yes")
                    {
                        this.Page.Title = ConfigurationManager.ConnectionStrings["ProTitle"].ConnectionString + "---答题正确率分析报表";
                        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                        connection.Open();
                        SqlCommand command = new SqlCommand("select AddRubric,ManagRubric from UserPower where UserCode='" + this.httpCookie_0.Value + "'", connection);
                        SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                        if (reader.Read())
                        {
                            this.ViewState["AddPower"] = reader["AddRubric"].ToString();
                            this.ViewState["ManagPower"] = reader["ManagRubric"].ToString();
                        }
                        reader.Close();
                        command.Dispose();
                        connection.Close();
                        connection.Dispose();
                        this.string_0 = this.publicFun_0.GetValues("select Count(*) as CountRe from CheckPaper where PaperID=" + this.int_0, "CountRe");
                        if (this.string_0.Trim() == "")
                        {
                            this.string_0 = "0";
                        }
                        this.ViewState["CountCheck"] = this.string_0;
                        this.ViewState["SortFiled"] = "a.RubricType";
                        this.ViewState["SortType"] = " asc";
                        string str = this.publicFun_0.GetValues("select ParmValue from SysParmInfo where ParmMemo='SubStrLength'", "ParmValue").Trim();
                        if (str.Trim() == "")
                        {
                            str = "20";
                        }
                        this.ViewState["SubStrLen"] = str;
                        this.method_0();
                        this.method_12();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.UPPart, this.Page.GetType(), "BCheck", "alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')", true);
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

